<template>
  <div>
    <h1>Movie</h1>
    <p>Count组件中的num值为---{{ num }}</p>
    <button @click="getMovieList">获取电影列表</button>
    <ul>
      <li v-for="item in movieList" :key="item.id">
        {{ item.albumName }}
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
export default defineComponent({
  name: 'Movie',
});
</script>
<script lang="ts" setup>
import useMovieState from '@/store/movie';
import useCountState from '@/store/count';
import { storeToRefs } from 'pinia';

const movieState = useMovieState();
const countState = useCountState();

const { num } = storeToRefs(countState);
const { movieList } = storeToRefs(movieState);

const { getMovieList } = movieState;
</script>

<style lang="less" scoped></style>
